import Vue from 'vue'
import Router from 'vue-router'
import Home from '../components/Home/Home.vue'
import productItem from '../components/ProductList/productItem.vue'
import productImport from '../components/ProductImport/productImport.vue'
import purchaseOrder from '../components/PurchaseList/purchaseOrder.vue'
import orderList from '../components/PurchaseList/orderList.vue'
import addOrder from '../components/PurchaseList/addOrder.vue'

Vue.use(Router)

export default new Router({
    mode:'history',
    routes: [{
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            name: 'Home',
            component: Home,
            meta: {
                title: "首页"
            }
        },
        {
            path: '/productitem',
            name: 'productItem',
            component: productItem,
            meta: {
                title: "商品列表"
            }
        },
        {
            path: '/productimport',
            name: 'productImport',
            component: productImport,
            meta: {
                title: "商品导入"
            }
        },
        {
            path: '/purchaseorder',
            name: 'purchaseOrder',
            component: purchaseOrder,
            meta: {
                title: "采购订单"
            },
            children: [{
                    path: 'orderlist',
                    name: 'orderList',
                    component: orderList,
                    meta: {
                        title: "订单列表"
                    }
                },
                {
                    path: 'addorder',
                    name: 'addOrder',
                    component: addOrder,
                    meta: {
                        title: "添加订单"
                    }
                }
            ]
        }
    ]
})